package com.lagou.controller;

import com.lagou.service.JedisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class TestRedisController {

    @Autowired
    JedisService jedisService;

    @RequestMapping("/get")
    public String toLoginPage(@RequestParam("key") String key){
        String s = jedisService.get(key);
        return s;
    }

    @RequestMapping("/set")
    public String toLoginPage(@RequestParam("key") String key,@RequestParam("value") String value){
        String s = jedisService.set(key,value,0);
        return s;
    }
}
